(find-auto-coding): Provide filename to `auto-coding-functions`
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Jun 2024 14:58:29 +0000 (10:58 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 9 Jun 2024 04:19:03 +0000 (00:19 -0400)
commit3ecc6b4f3c2b070ed2c4463e2c5d8755ccc19f1c
tree36ec13f004e81faad33f8a42e30a96c4a40451d5
parentce5d004b5b093842d9c46976c50453015fe1a7e7
(find-auto-coding): Provide filename to `auto-coding-functions`

Allow `auto-coding-functions` to know the file name.
Motivated by the needs of Editorconfig support.

* lisp/international/mule.el (auto-coding-file-name): New var.
(find-auto-coding): Let-bind it for `auto-coding-functions`.
Document the expectation that the arg be an absolute file name.

* doc/lispref/nonascii.texi (Default Coding Systems):
Mention `auto-coding-file-name`.

* test/lisp/international/mule-util-resources/test.utf-16le: New file.
* test/lisp/international/mule-tests.el (mule-tests--dir): New var.
(mule-tests--auto-coding): New fun.
(mule-tests--auto-coding-functions): New test.
doc/lispref/nonascii.texi
etc/NEWS
lisp/international/mule.el
test/lisp/international/mule-tests.el
test/lisp/international/mule-util-resources/test.utf-16le [new file with mode: 0644]